#include "StdAfx.h"
#include "Patch.h"
#include "OLE32Hook.h"
#include "WMPHook.h"

#pragma unmanaged

void* SelectOLE32Method(int num) {
	void* proc = ole32Hook[num];
	if (!proc) {
		proc = ole32Save[num];
	}
	return proc;
}

HRESULT WINAPI CoCreateInstanceHook(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID FAR* ppv) {
	SyncFuncHook(HRESULT, PCoCreateInstance, SelectOLE32Method(0), (rclsid, pUnkOuter, dwClsContext, riid, ppv));
}
